// Toolbar
import { ReactComponent as IconBoxSelection } from './toolbar/icon-box-selection.svg';
import { ReactComponent as IconBoxZoom } from './toolbar/icon-box-zoom.svg';
import { ReactComponent as IconClipPlane } from './toolbar/icon-clip-plane.svg';
import { ReactComponent as IconDoubleClickZoom } from './toolbar/icon-double-click-zoom.svg';
import { ReactComponent as IconFitVisualArea } from './toolbar/icon-fit-visual-area.svg';
import { ReactComponent as IconPickModeEdge } from './toolbar/icon-pick-mode-edge.svg';
import { ReactComponent as IconPickModeFace } from './toolbar/icon-pick-mode-face.svg';
import { ReactComponent as IconPickModeVertex } from './toolbar/icon-pick-mode-vertex.svg';
import { ReactComponent as IconPickModeVolume } from './toolbar/icon-pick-mode-volume.svg';
import { ReactComponent as IconPickModeIntellectVolume } from './toolbar/icon-pick-mode-intellect-volume.svg';
import { ReactComponent as IconScreenshot } from './toolbar/icon-screenshot.svg';
import { ReactComponent as IconWireframe } from './toolbar/IconWireframe.svg';

// Tree
import { WarningOutlined as IconWarning } from '@ant-design/icons';
import IconMoreBox from '@mui/icons-material/AddBoxOutlined';
import ChevronRightIcon from '@mui/icons-material/ChevronRight';
import ChevronDownIcon from '@mui/icons-material/ExpandMore';
import IconLessBox from '@mui/icons-material/IndeterminateCheckBoxOutlined';
import { ForkOutlined } from '@ant-design/icons';
import { ReactComponent as IconBoundary } from './tree/icon-boundary.svg';
import { ReactComponent as IconCollections } from './tree/icon-collections.svg';
import { ReactComponent as IconGeometries } from './tree/icon-geometries.svg';
import { ReactComponent as IconGeometry } from './tree/icon-geometry.svg';
import { ReactComponent as IconMaterial } from './tree/icon-material.svg';
import { ReactComponent as IconSolve } from './tree/icon-solve.svg';
import { ReactComponent as IconMesh } from './tree/icon-mesh.svg';
import { ReactComponent as IconParameterUnits } from './tree/icon-parameterUnits.svg';
import { ReactComponent as IconProperty } from './tree/icon-property.svg';
import { ReactComponent as IconTask } from './tree/icon-task.svg';
import { ReactComponent as IconResearchSettings } from './tree/icon-researchSettings.svg';
import { ReactComponent as IconResult } from './tree/icon-result.svg';
import { ReactComponent as IconSimulations } from './tree/icon-simulation.svg';
import { ReactComponent as IconStructure } from './tree/icon-structure.svg';
import { ReactComponent as IconVisualizations } from './tree/icon-visualizations.svg';
import { ReactComponent as IconVolume } from './tree/icon-volume.svg';

const icons = {
  // 网格线框切换显示/隐藏
  IconWireframe: <IconWireframe />,

  IconPickModeVertex: <IconPickModeVertex />,
  IconPickModeIntellectVolume: <IconPickModeIntellectVolume />,
  IconPickModeEdge: <IconPickModeEdge />,
  IconPickModeFace: <IconPickModeFace />,
  IconPickModeVolume: <IconPickModeVolume />,
  IconScreenshot: <IconScreenshot />,
  IconClipPlane: <IconClipPlane />,

  IconBoxSelection: <IconBoxSelection />,
  IconBoxZoom: <IconBoxZoom />,
  IconFitVisualArea: <IconFitVisualArea />,
  IconDoubleClickZoom: <IconDoubleClickZoom />,

  IconGeometries: <IconGeometries />,
  IconCollections: <IconCollections />,
  IconTask: <IconTask />,
  IconWarning: <IconWarning style={{ color: 'red' }} />,

  Icon_Structural: <IconStructure />,
  IconVisualizations: <IconVisualizations />,
  Icon_materials: <IconMaterial />,
  Icon_parameterUnits: <IconParameterUnits />,
  Icon_boundaries: <IconBoundary />,
  IconGeometry: <IconGeometry />,
  Icon_properties: <IconProperty />,
  IconResult: <IconResult />,
  Icon_solver: <IconResearchSettings />,
  Icon_Static: <IconSolve />,
  Icon_Default: <ForkOutlined />,
  IconMesh: <IconMesh />,
  IconChevronRight: <ChevronRightIcon />,
  IconChevronMore: <ChevronDownIcon />,
  IconLessBox: <IconLessBox sx={{ fontSize: 11, background: '#fff0' }} />,
  IconMoreBox: <IconMoreBox sx={{ fontSize: 11, background: '#fff0' }} />,
  IconSimulations: <IconSimulations />,
  IconVolume: <IconVolume />,
};

export default function Icons({
  name,
  defaultName,
}: {
  name: string;
  defaultName?: string;
}) {
  const icon = icons[name];
  if (!icon && defaultName) {
    return icons[defaultName];
  }
  return icons[name];
}
